<?php

namespace app\common\validate;

use think\Validate;

class Wdocument extends Validate
{
    protected $rule = [
        'name' => 'require|length:2,100',
        'type' => 'require',
        'image' => 'require',
        'status' => 'require|in:normal,hidden',
    ];
    
    protected $message = [
        'name.require' => '标题不能为空',
        'name.length' => '标题长度必须在2-100个字符之间',
        'type.require' => '分类不能为空',
        'status.in' => '状态值不正确',
    ];
    
    protected $scene = [
        'add' => ['name', 'type', 'image',  'status'],
        'edit' => ['name', 'type', 'image', 'status']
    ];
}